﻿namespace Devonline.Entity;

/// <summary>
/// 具有上下级关系的数据对象模型基础接口字符串类型的默认基类
/// </summary>
public abstract class EntitySetWithTimeRange : EntitySetWithTimeRange<string>, ITimeRange, IEntitySet { }

/// <summary>
/// 具有上下级关系的数据对象模型基础接口
/// epplus 自动导出的列头仅支持 DisplayName 和 Description 特性
/// </summary>
public abstract class EntitySetWithTimeRange<TKey> : EntitySet<TKey>, ITimeRange<TKey>, IEntitySet<TKey> where TKey : IConvertible
{
    public EntitySetWithTimeRange()
    {
        StartTime = DateTime.UtcNow;
    }

    /// <summary>
    /// 起始时间
    /// </summary>
    [Column("start_time"), DisplayName("起始时间"), Excel]
    public virtual DateTime StartTime { get; set; }
    /// <summary>
    /// 结束时间
    /// </summary>
    [Column("end_time"), DisplayName("结束时间"), Excel]
    public virtual DateTime? EndTime { get; set; }
}